package com.yunchang.springboot.mapper.finance;

import com.yunchang.springboot.models.DO.finance.FinanceAccountsSettlement;
import com.yunchang.springboot.models.DO.finance.FinanceAccountsSettlementTableColumns;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FinanceAccountsSettlementMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(FinanceAccountsSettlement record);

    int insertSelective(FinanceAccountsSettlement record);

    FinanceAccountsSettlement selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FinanceAccountsSettlement record);

    int updateByPrimaryKey(FinanceAccountsSettlement record);

    /**
     * 根据每个表对应的字段和月份查找到是否这个月数据都已经处理过了
     * @param accountsSettlementTableColumns
     * @param period
     * @return
     */
    List<Integer> getSettlementStatusFromLastMonth(@Param("accountsSettlementTableColumns") FinanceAccountsSettlementTableColumns accountsSettlementTableColumns,
                                                  @Param("period")String period);

    /**
     * 查找这个账期是否有结账标记
     * @param period
     * @return
     */
    FinanceAccountsSettlement selectDataByPeriod(@Param("period") String period);

    int replaceData(@Param("accountsSettlement")FinanceAccountsSettlement accountsSettlement);
}